package org.hcyspartnoc.demo.dao;

import org.hcyspartnoc.demo.entity.SpecificRequire;
import org.hcyspartnoc.demo.entity.TeachingSteps;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.neo4j.repository.query.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface TeachingStepsDao extends Neo4jRepository<TeachingSteps,Long> {


    @Query("MATCH (n) " +
            "where id(n) = $nodeId " +
            "CREATE (c:course {name: $name}) " +
            "MERGE (c)-[:属于]->(n)")
    void saveTeachingStepNode(@Param("nodeId") Integer nodeId,
                              @Param("name") String name);
}
